package com.hailiang.saas.auth.emuns;

public enum AuthEndpointEnum {

    // 浏览器登陆方式(不论是PC端还是移动端均按照该枚举值进行)
    WEB_BROWSER("WEB_BROWSER", "web browser"),
    // 移动端登陆方式
    MOBILE("MOBILE", "mobile app");

    private String code;
    private String name;

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    AuthEndpointEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static AuthEndpointEnum getByCode(String code) {
        for (AuthEndpointEnum st : AuthEndpointEnum.values()) {
            if ( st.code.equals(code)) {
                return st;
            }
        }
        return null;
    }
}
